#include<stdio.h>
#include<stdlib.h>
#include<string.h> // memset 
#include<time.h>
#include<string>
#include<iostream>
#include <memory>


#include<sys/types.h> //使用网络包含的库
#include<unistd.h>
#include<arpa/inet.h>
#include<netinet/in.h>  
#include<thread>

#include "HqHttpHead.hpp"
#include "config.h"
#include "tools.h"
#include "mythreadpool.hpp"
 



/*
netstat -anp -tulpn 
*/

// 线程处理函数，必须符合 HTaskFunc 类型
void* do_work( unique_ptr<HTASK_Param>& param );
 

class BIOServer{

protected:
    std::string host;
    int port;
    unique_ptr< Thread_pool<Thread_Task, HTask_Func, HTASK_Param>   > mypool;

public:
    BIOServer(std::string host, int port, int Thread_NUM=8);
    int startBIOServer();
};
 
void testBIOServer();